import {reqOrderInfo,reqAddressInfo} from '@/api'
const state={
  addressinfo:[],
  orderInfo:{}
}
const mutations={
  GETADDRESSINFO(state,addressinfo){
    state.addressinfo=addressinfo
  },
  GETORDERINFO(state,orderInfo){
    state.orderInfo=orderInfo
  }
}
const actions={
  async getUserAddress({commit}){
   let result= await reqAddressInfo()
   if(result.code==200){
    commit("GETADDRESSINFO",result.data)
   }
   console.log(result)
  },
  async getOrderInfo({commit}){
    let result=await reqOrderInfo()
    if(result.code==200){
      commit("GETORDERINFO",result.data)
     }
     console.log(result)
  }
}
const getters={}
export default{
  state,
  mutations,
  actions,
  getters
}